package com.test.service.Impl;

import com.test.dao.EmployeeDao;
import com.test.domain.Employee;
import com.test.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    private EmployeeDao employeeDao;

    /**
     * 分页和条件查询
     * @param map
     * @return
     */
    @Override
    public List<Employee> list(Map<String,Object> map) {
        return employeeDao.list(map);
    }

    /**
     * 查询数据
     * @param map
     * @return
     */
    @Override
    public int count(Map<String,Object> map) {
        return employeeDao.count(map);
    }

    /**
     * 修改数据
     * @param employeelist
     * @return
     */
    @Override
    public int update(Employee employeelist) {
        return employeeDao.update(employeelist);
    }

    /**
     * 新增数据
     * @param employeelist
     * @return
     */
    @Override
    public int save(Employee employeelist) {
        return employeeDao.save(employeelist);
    }

    /**
     * 单个删除数据
     * @param id
     * @return
     */
    @Override
    public int remove(Integer id) {
        return employeeDao.remove(id);
    }

    /**
     * 批量删除数据
     * @param ids
     * @return
     */
    @Override
    public int batchRemove(Integer[] ids) {
        return employeeDao.batchRemove(ids);
    }
}
